import 'package:flutter/material.dart';
import 'package:my_flutter_core/config/my_font_style.dart';

/// This is for [AppBar] subtitle definition.
///
/// The text color will auto change if app primary color changes if its color is not specified explicitly.
/// But we also like to have a lighter color in subtitle.
/// [Opacity] widget helps.
class AppBarSubtitle extends StatelessWidget {
  const AppBarSubtitle(this.subtitle, {super.key});

  final String subtitle;

  @override
  Widget build(BuildContext context) {
    return Opacity(
      opacity: 0.6,
      child: Text(
        subtitle,
        style: MyFontStyle.appBarSubtitleStyle,
      ),
    );
  }
}
